﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<List<ShowCarInfo>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Home
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MoreLinks" runat="server">
    <% Html.RenderAction("Menu","CarView"); %>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div class="body_area1">
        <div class="tick_head1"> </div>
    </div>
    <div class="mid">
        <a href="<%: Url.Action("Index","CarView") %>">
                <img  src="/Content/Images/Cars/crash.jpg"/>
            </a> 
    </div>
    <div class="right_area">
        <div class="morelinks_top"></div>
        <div class="rightlinks_area">
            <div class="morelinks_head"><%:Html.Resource("Sitemap_rightlink")%></div>
            <dl id="marquee">
                    <dt>
                        <%foreach (var item in Model)
                          { %>
                          <div class="morelink1">
                          <a href="<%:Url.Action("Detail","CarView",new { id= item.CarId}) %>">
                          <span class="links_text"><%:item.CarName %></span></a>
                          </div>
                          <%} %>
                    </dt>
                    <dd></dd>
            </dl>
        </div>
        <div class="morelinks_bottom"></div>
    </div>

   
   <script type="text/javascript">
       var Marquee = function (id) {
           var container = document.getElementById(id);
           if (1) {

               original = container.getElementsByTagName("dt")[0],
              clone = container.getElementsByTagName("dd")[0],
              speed = arguments[1] || 100;
               clone.innerHTML = original.innerHTML;
               //container.scrollTop = clone.offsetTop;
               var rolling = function () {
                   if (container.scrollTop == original.offsetHeight) {
                       container.scrollTop = 0;
                   } else {
                       container.scrollTop++;
                   }
               }
           }
           var timer = setInterval(rolling, speed)//设置定时器
           container.onmouseover = function () { clearInterval(timer) } //鼠标移到marquee上时，清除定时器，停止滚动
           container.onmouseout = function () { timer = setInterval(rolling, speed) } //鼠标移开时重设定时器
       }
       window.onload = function () {
           Marquee("marquee");
       }

    </script> 
<style type="text/css">
  #marquee {
    position:relative;
    height:150px;
    width:180px;
    overflow:hidden;
  }

  #marquee dd {
    margin:0px;
    padding:0px;
  }
</style>
</asp:Content>





